home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / LineLet / LineLet.jar / Linelet.class (.txt) < prev   
Encoding:
Java Class File  |  2001-03-30  |  1.5 KB  |  40 lines

  1. import javax.microedition.lcdui.Command;
  2. import javax.microedition.lcdui.CommandListener;
  3. import javax.microedition.lcdui.Display;
  4. import javax.microedition.lcdui.Displayable;
  5. import javax.microedition.midlet.MIDlet;
  6.  
  7. public class Linelet extends MIDlet implements CommandListener {
  8.    private LineCanvas myCanvas = new LineCanvas(this);
  9.    private Command exitCommand = new Command("Exit", 7, 2);
  10.  
  11.    public Linelet() {
  12.       this.myCanvas.addCommand(this.exitCommand);
  13.       this.myCanvas.setCommandListener(this);
  14.    }
  15.  
  16.    public void startApp() {
  17.       try {
  18.          Display.getDisplay(this).setCurrent(this.myCanvas);
  19.          this.myCanvas.startProcess();
  20.       } catch (Exception var2) {
  21.          System.out.println(((Throwable)var2).getMessage());
  22.       }
  23.  
  24.    }
  25.  
  26.    public void pauseApp() {
  27.    }
  28.  
  29.    public void destroyApp(boolean var1) {
  30.    }
  31.  
  32.    public void commandAction(Command var1, Displayable var2) {
  33.       if (var1 == this.exitCommand) {
  34.          this.destroyApp(false);
  35.          ((MIDlet)this).notifyDestroyed();
  36.       }
  37.  
  38.    }
  39. }
  40.